
package com.sskj.ws.controller;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;

import com.sskj.jkzx.domain.entity.amap.message.JdywtxMessage;
import com.sskj.jkzx.domain.entity.amap.yc.YcMarkerInfo;
import com.sskj.jkzx.vo.RequestMessage;
import com.sskj.jkzx.vo.ResponseMessage;

@Controller
public class WsController {

	protected final Log logger = LogFactory.getLog(WsController.class);

	@MessageMapping("/welcome")
	@SendTo("/topic/demo")
	public ResponseMessage say(RequestMessage message) {

		return new ResponseMessage("welcome, " + message.getName() + "!");
	}

	@MessageMapping("/jdmessage")
	@SendTo("/topic/jdmessage")
	public JdywtxMessage sendJdywtxMessage(JdywtxMessage message) {

		logger.info(message.toString());
		return message;
	}

	/**
	 * 扬尘设备实时数据
	 * 
	 * @param ycMarkerInfo
	 *            扬尘设备实时数据
	 * @return
	 */
	@MessageMapping("/ycsj")
	@SendTo("/topic/ycsj")
	public YcMarkerInfo ycsbsssj(YcMarkerInfo ycMarkerInfo) {

		return ycMarkerInfo;
	}

}
